//package com.bart.hsp.scala.ch11.sec15

/**
 * sealed 修饰的类是【密封类】只能在当前scala文件中使用不能再别的scala中使用
 */
sealed abstract class TrafficLightColor


case object Red extends TrafficLightColor

case object Yellow extends TrafficLightColor

case object Green extends TrafficLightColor

for (color <- Array(Red, Yellow, Green))
  println(
    color match {
      case Red => "stop"
      case Yellow => "hurry up"
      case Green => "go"
    })
